Skip to content

CI: build the docs for pull requests into develop as well - #1104

Open
thc1006 wants to merge 1 commit into
RocketPy-Team:developfrom
thc1006:ci/build-docs-for-develop-prs
Open

CI: build the docs for pull requests into develop as well#1104
thc1006 wants to merge 1 commit into
RocketPy-Team:developfrom
thc1006:ci/build-docs-for-develop-prs

Conversation

@thc1006

@thc1006 thc1006 commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

Addresses #1099. Not Closes, because the closing keyword only fires when the pull request targets the default branch, and this one targets develop. #1094 and #1096 are both still open for exactly that reason.

Pull request type

  • Code maintenance (refactoring, formatting, tests)

Checklist

  • Docs have been reviewed and added / updated

One workflow file changes and nothing under rocketpy/ or tests/ does, so no code test was added. The Tests, Linters and Documentation workflows all pass on the current head.

Current behavior

  pull_request:
    branches: [master]

branches filters on the pull request's base, and almost nothing here targets master. Of the last 30 pull requests, 25 went to develop and 3 to master. So the build that runs with -W --keep-going first sees a docs change when develop is promoted, in a batch, a long way from whatever caused it.

#1097 is the case that prompted this. It changed docs/user/custom_sampler.rst, targeted develop, and its only check was the auto-assign workflow. My local sphinx-build was the only thing standing behind the reStructuredText, which is not where that check belongs.

The path filter includes rocketpy/**, because docstrings feed the autodoc reference, so this is not only about docs/. A docstring edit merged into develop can break the API pages with nothing to say so.

New behavior

    branches: [master, develop]

push is deliberately left on master alone. The pull request check is where the feedback is useful, and running both would pay twice for a second opinion on the same commit.

Breaking change

  • No

Additional information

Two things worth knowing before adding a -W build to every docs-affecting pull request. A check rather than a gate: whether it can block a merge is a branch-rule decision, not this file's, and a workflow with top-level paths filters is the wrong shape to make required as it stands.

It is not slow. The job sets DOCS_SKIP_EXECUTE: "1", so notebooks are not executed and jupyter-execute cells render as static blocks. The documentation examples therefore make no live weather or external-data calls, which is the expensive and flaky part; the job still installs pandoc and the Python dependencies like any other. The run on this pull request took 2m27s.

develop builds clean today, so this does not switch on a check that is already red. This pull request proves it rather than arguing it: .github/workflows/docs.yml is inside the workflow's own paths list, so the change triggered itself. Documentation / build-docs (3.12) ran against the merge ref and the warnings-as-errors build finished clean.

The workflow asks for contents: read and uses no repository or organization secrets, so a fork pull request runs it with a read-only token, subject to whatever approval policy the repository applies to outside contributors. That is where it is needed most.

It has to stay on pull_request rather than pull_request_target: it checks out the merge tree and then installs and imports the package, docs/conf.py and the Sphinx extensions from it, all of which the pull request controls.

`branches` filters on a pull request's base, and almost every PR here is opened
against develop: 25 of the last 30, with 3 against master. So the build that
runs with -W --keep-going saw a docs change for the first time in a release
batch, well away from whatever caused it.

The path filter already keeps this off PRs that cannot affect the docs, and
`rocketpy/**` is in it because docstrings feed the autodoc reference, so a
docstring edit merged into develop could break the API pages unnoticed too.

`push` is left on master alone. The pull request check is where the feedback is
worth having, and running both would double the cost for a second opinion on
the same commit.

Signed-off-by: thc1006 <84045975+thc1006@users.noreply.github.com>
@thc1006
thc1006 requested a review from a team as a code owner August 8, 2026 03:04
@codecov

codecov Bot commented Aug 8, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 82.55%. Comparing base (e0ff281) to head (7656551).
⚠️ Report is 24 commits behind head on develop.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #1104      +/-   ##
===========================================
+ Coverage    82.18%   82.55%   +0.37%     
===========================================
  Files          122      128       +6     
  Lines        16355    16555     +200     
===========================================
+ Hits         13441    13667     +226     
+ Misses        2914     2888      -26     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@thc1006

thc1006 commented Aug 8, 2026

Copy link
Copy Markdown
Contributor Author

The new trigger has now exercised itself: .github/workflows/docs.yml is inside the workflow's own paths list, so this change fired it, and Documentation / build-docs (3.12) ran against the merge ref and finished clean with warnings as errors. Nothing but the base-branch filter changes; paths, permissions and build steps are as they were.

I have corrected four things in the description that claimed more than the change delivers.

Closes #1099 is now Addresses #1099. The keyword only closes when the pull request targets the default branch, and this targets develop. I had already watched that happen twice this week, with #1094 and #1096 still open behind merged pull requests, and wrote Closes anyway. The issue will need closing by hand.

I had called this "a gate". It produces a check; whether anything blocks on it is a branch rule rather than this file. Worth adding that this workflow is not in a shape to be made required as it stands, because a top-level paths filter means a pull request that touches no documentation never starts the check at all rather than passing it.

I had written that "nothing reaches the network". The documentation examples make no live calls, which is the part that matters, but the job still does apt-get install pandoc and four pip install commands, so as written it was simply wrong.

The validation section described a local build that had to exclude the notebooks for want of pandoc. The real run has since made that redundant, so it now cites that instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant